package day020.homework;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;
import java.util.ArrayList;
import java.util.List;

public class P5 {
    public static void main(String[] args) throws IOException {
        BufferedReader br = new BufferedReader(new FileReader("D:\\day020\\p4.txt"));
        List<Student> stuList = new ArrayList<>();

        String line;
        while ((line = br.readLine()) != null) {
            String[] strs = line.split(",");
            Student stu = new Student(strs[0], strs[1], Integer.parseInt(strs[2]), Double.parseDouble(strs[3]));
            stuList.add(stu);
        }

        for (Student s : stuList) {
            System.out.println(s);
        }
    }
}
